/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JanelaCadastroAluno.java
 *
 * Created on 09/04/2011, 15:14:26
 */
package gui;

import dominio.Aluno;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Date;

/**
 *
 * @author Nathalie.ramos
 */
public class JanelaCadastroAluno extends javax.swing.JFrame implements JanelaCadastro {

    /** Creates new form JanelaCadastroAluno */
    public JanelaCadastroAluno() {
        initComponents();
        formatarCamposDeNumeros();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        painelCadastro = new javax.swing.JPanel();
        campoNome = new javax.swing.JTextField();
        sexo = new javax.swing.JPanel();
        f = new javax.swing.JRadioButton();
        m = new javax.swing.JRadioButton();
        campoCpf = new javax.swing.JTextField();
        campoRg = new javax.swing.JTextField();
        campoNaturalidade = new javax.swing.JTextField();
        campoProfMae = new javax.swing.JTextField();
        campoEscola = new javax.swing.JTextField();
        campoTurno = new javax.swing.JTextField();
        campoProfPai = new javax.swing.JTextField();
        painelBolsaFamilia = new javax.swing.JPanel();
        n = new javax.swing.JRadioButton();
        s = new javax.swing.JRadioButton();
        campoTelContato = new javax.swing.JTextField();
        campoEndContato = new javax.swing.JTextField();
        campoNumRegistro = new javax.swing.JTextField();
        campoFolha = new javax.swing.JTextField();
        campoLivro = new javax.swing.JTextField();
        campoCartorio = new javax.swing.JTextField();
        campoCidade = new javax.swing.JTextField();
        campoPais = new javax.swing.JTextField();
        campoRespCliente = new javax.swing.JTextField();
        campoRespInscricao = new javax.swing.JTextField();
        painelSituacao = new javax.swing.JPanel();
        a = new javax.swing.JRadioButton();
        dataNascimento = new com.toedter.calendar.JDateChooser();
        dataEmissao = new com.toedter.calendar.JDateChooser();
        painelTriagem = new javax.swing.JPanel();
        fisioterapica = new javax.swing.JCheckBox();
        psicologica = new javax.swing.JCheckBox();
        medica = new javax.swing.JCheckBox();
        pedagogica = new javax.swing.JCheckBox();
        fonoaudiologica = new javax.swing.JCheckBox();
        psicomotora = new javax.swing.JCheckBox();
        painelTerapias = new javax.swing.JPanel();
        apPedagogico = new javax.swing.JCheckBox();
        ofPedagogico = new javax.swing.JCheckBox();
        estimulacao = new javax.swing.JCheckBox();
        Fisioterapia = new javax.swing.JCheckBox();
        fonoterapia = new javax.swing.JCheckBox();
        outraEscola = new javax.swing.JCheckBox();
        edFisiEscolar = new javax.swing.JCheckBox();
        treinaDesportivo = new javax.swing.JCheckBox();
        EsProSevLopes = new javax.swing.JCheckBox();
        educProf = new javax.swing.JCheckBox();
        psicomotricidade = new javax.swing.JCheckBox();
        ofLinguagem = new javax.swing.JCheckBox();
        brinquedoteca = new javax.swing.JCheckBox();
        ludoterapia = new javax.swing.JCheckBox();
        artEduc = new javax.swing.JCheckBox();
        verbotonal = new javax.swing.JCheckBox();
        libras = new javax.swing.JCheckBox();
        painelBotoes1 = new javax.swing.JPanel();
        botaoCadastrar = new javax.swing.JButton();
        botaoPesquisar = new javax.swing.JButton();
        botaoAlterar = new javax.swing.JButton();
        painelBotoes2 = new javax.swing.JPanel();
        botaoListar = new javax.swing.JButton();
        botaoLimpar = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        botaoObserva = new javax.swing.JButton();
        botaoEncerrar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cadastro de Alunos");

        painelCadastro.setBorder(javax.swing.BorderFactory.createTitledBorder("CADASTRO"));

        campoNome.setBorder(javax.swing.BorderFactory.createTitledBorder("Nome"));

        sexo.setBorder(javax.swing.BorderFactory.createTitledBorder("Sexo"));

        f.setText("F");
        f.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fActionPerformed(evt);
            }
        });

        m.setText("M");
        m.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout sexoLayout = new javax.swing.GroupLayout(sexo);
        sexo.setLayout(sexoLayout);
        sexoLayout.setHorizontalGroup(
            sexoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sexoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(f)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(m)
                .addContainerGap())
        );
        sexoLayout.setVerticalGroup(
            sexoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sexoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(f)
                .addComponent(m))
        );

        campoCpf.setBorder(javax.swing.BorderFactory.createTitledBorder("CPF"));

        campoRg.setBorder(javax.swing.BorderFactory.createTitledBorder("RG"));

        campoNaturalidade.setBorder(javax.swing.BorderFactory.createTitledBorder("Naturalidade"));

        campoProfMae.setBorder(javax.swing.BorderFactory.createTitledBorder("Profissão da Mãe"));

        campoEscola.setBorder(javax.swing.BorderFactory.createTitledBorder("Escola"));

        campoTurno.setBorder(javax.swing.BorderFactory.createTitledBorder("Turno"));

        campoProfPai.setBorder(javax.swing.BorderFactory.createTitledBorder("Profissão do Pai"));

        painelBolsaFamilia.setBorder(javax.swing.BorderFactory.createTitledBorder("Bolsa Família"));

        n.setText("N");
        n.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nActionPerformed(evt);
            }
        });

        s.setText("S");
        s.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelBolsaFamiliaLayout = new javax.swing.GroupLayout(painelBolsaFamilia);
        painelBolsaFamilia.setLayout(painelBolsaFamiliaLayout);
        painelBolsaFamiliaLayout.setHorizontalGroup(
            painelBolsaFamiliaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelBolsaFamiliaLayout.createSequentialGroup()
                .addComponent(n)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(s))
        );
        painelBolsaFamiliaLayout.setVerticalGroup(
            painelBolsaFamiliaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelBolsaFamiliaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(n)
                .addComponent(s))
        );

        campoTelContato.setBorder(javax.swing.BorderFactory.createTitledBorder("Tel. Contato"));

        campoEndContato.setBorder(javax.swing.BorderFactory.createTitledBorder("Endereço para Contato"));
        campoEndContato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoEndContatoActionPerformed(evt);
            }
        });

        campoNumRegistro.setBorder(javax.swing.BorderFactory.createTitledBorder("N. Registro"));

        campoFolha.setBorder(javax.swing.BorderFactory.createTitledBorder("Folha"));

        campoLivro.setBorder(javax.swing.BorderFactory.createTitledBorder("Livro"));
        campoLivro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoLivroActionPerformed(evt);
            }
        });

        campoCartorio.setBorder(javax.swing.BorderFactory.createTitledBorder("Cartório"));

        campoCidade.setBorder(javax.swing.BorderFactory.createTitledBorder("Cidade"));

        campoPais.setBorder(javax.swing.BorderFactory.createTitledBorder("Pais"));

        campoRespCliente.setBorder(javax.swing.BorderFactory.createTitledBorder("Responsável pelo Cliente"));

        campoRespInscricao.setBorder(javax.swing.BorderFactory.createTitledBorder("Responsável pela Inscrição"));

        painelSituacao.setBorder(javax.swing.BorderFactory.createTitledBorder("Situação"));

        a.setText("Ativo");

        javax.swing.GroupLayout painelSituacaoLayout = new javax.swing.GroupLayout(painelSituacao);
        painelSituacao.setLayout(painelSituacaoLayout);
        painelSituacaoLayout.setHorizontalGroup(
            painelSituacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelSituacaoLayout.createSequentialGroup()
                .addComponent(a)
                .addContainerGap())
        );
        painelSituacaoLayout.setVerticalGroup(
            painelSituacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(a)
        );

        dataNascimento.setBorder(javax.swing.BorderFactory.createTitledBorder("Nascimento"));

        dataEmissao.setBorder(javax.swing.BorderFactory.createTitledBorder("Emissão"));

        javax.swing.GroupLayout painelCadastroLayout = new javax.swing.GroupLayout(painelCadastro);
        painelCadastro.setLayout(painelCadastroLayout);
        painelCadastroLayout.setHorizontalGroup(
            painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelCadastroLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(campoNome, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(painelCadastroLayout.createSequentialGroup()
                        .addComponent(campoNumRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoFolha, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoCartorio, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoRespInscricao, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoRespCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelCadastroLayout.createSequentialGroup()
                        .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(painelCadastroLayout.createSequentialGroup()
                                    .addComponent(campoNaturalidade, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(campoProfPai, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(campoProfMae, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(painelCadastroLayout.createSequentialGroup()
                                    .addComponent(campoEscola, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(campoTurno, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(campoTelContato, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(painelCadastroLayout.createSequentialGroup()
                                .addComponent(sexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelCadastroLayout.createSequentialGroup()
                                .addComponent(campoEndContato, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(campoCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(painelCadastroLayout.createSequentialGroup()
                                    .addComponent(campoRg, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(painelBolsaFamilia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(dataNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(painelSituacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(campoPais, javax.swing.GroupLayout.PREFERRED_SIZE, 471, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        painelCadastroLayout.setVerticalGroup(
            painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelCadastroLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(painelSituacao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(dataNascimento, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(painelBolsaFamilia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(campoCpf, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(campoRg, javax.swing.GroupLayout.Alignment.LEADING)))
                    .addComponent(sexo, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)
                    .addComponent(campoNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoNaturalidade)
                    .addComponent(campoProfPai)
                    .addComponent(campoProfMae, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoPais, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(campoEndContato, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE)
                        .addComponent(campoCidade))
                    .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(campoEscola, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(campoTurno)
                        .addComponent(campoTelContato, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelCadastroLayout.createSequentialGroup()
                        .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(campoNumRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE)
                            .addComponent(campoFolha, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE)
                            .addComponent(campoLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE)
                            .addComponent(campoCartorio, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE))
                        .addGap(10, 10, 10))
                    .addComponent(dataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(painelCadastroLayout.createSequentialGroup()
                        .addGroup(painelCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(campoRespInscricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(campoRespCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 45, Short.MAX_VALUE))
                        .addContainerGap())))
        );

        painelTriagem.setBorder(javax.swing.BorderFactory.createTitledBorder("TRIAGEM"));

        fisioterapica.setText("Fisioterápica");

        psicologica.setText("Psicológica");

        medica.setText("Médica");

        pedagogica.setText("Pedagógica");

        fonoaudiologica.setText("Fonoaudiológica");

        psicomotora.setText("Psicomotora");

        javax.swing.GroupLayout painelTriagemLayout = new javax.swing.GroupLayout(painelTriagem);
        painelTriagem.setLayout(painelTriagemLayout);
        painelTriagemLayout.setHorizontalGroup(
            painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTriagemLayout.createSequentialGroup()
                .addGroup(painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fisioterapica)
                    .addComponent(medica)
                    .addComponent(psicologica))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pedagogica)
                    .addComponent(psicomotora)
                    .addComponent(fonoaudiologica)))
        );
        painelTriagemLayout.setVerticalGroup(
            painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTriagemLayout.createSequentialGroup()
                .addGroup(painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(psicologica)
                    .addComponent(pedagogica))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(fisioterapica)
                    .addComponent(fonoaudiologica))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelTriagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(medica)
                    .addComponent(psicomotora)))
        );

        painelTerapias.setBorder(javax.swing.BorderFactory.createTitledBorder("TERAPIAS"));

        apPedagogico.setText("Apoio Pedagógico");

        ofPedagogico.setText("Oficina Pedagogica");

        estimulacao.setText("Estimulação");

        Fisioterapia.setText("Fisioterapia");

        fonoterapia.setText("Fonoterapia");

        outraEscola.setText("Outra Escola");

        edFisiEscolar.setText("Ed Fisica Escolar");

        treinaDesportivo.setText("Treinamento Desportivo");

        EsProSevLopes.setText("Es. Prof. Severino Lopes");

        educProf.setText("Educação Profissional");
        educProf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                educProfActionPerformed(evt);
            }
        });

        psicomotricidade.setText("psicomotricidade");

        ofLinguagem.setText("Oficina de Linguagem");

        brinquedoteca.setText("Brinquedoteca");

        ludoterapia.setText("Ludoterapia");

        artEduc.setText("Arte e Educação");

        verbotonal.setText("Verbotonal");

        libras.setText("Libras");

        javax.swing.GroupLayout painelTerapiasLayout = new javax.swing.GroupLayout(painelTerapias);
        painelTerapias.setLayout(painelTerapiasLayout);
        painelTerapiasLayout.setHorizontalGroup(
            painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTerapiasLayout.createSequentialGroup()
                .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelTerapiasLayout.createSequentialGroup()
                        .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(apPedagogico)
                            .addComponent(ofPedagogico)
                            .addComponent(estimulacao)
                            .addComponent(Fisioterapia))
                        .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(educProf)
                            .addComponent(EsProSevLopes)
                            .addComponent(treinaDesportivo)
                            .addGroup(painelTerapiasLayout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(edFisiEscolar)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(brinquedoteca)
                            .addComponent(ludoterapia)
                            .addComponent(artEduc, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(libras))
                        .addGap(18, 18, 18)
                        .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(outraEscola)
                            .addComponent(verbotonal)
                            .addComponent(psicomotricidade)
                            .addComponent(fonoterapia)))
                    .addComponent(ofLinguagem))
                .addContainerGap(187, Short.MAX_VALUE))
        );
        painelTerapiasLayout.setVerticalGroup(
            painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTerapiasLayout.createSequentialGroup()
                .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(apPedagogico)
                    .addComponent(edFisiEscolar)
                    .addComponent(brinquedoteca)
                    .addComponent(fonoterapia))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ofPedagogico)
                    .addComponent(treinaDesportivo)
                    .addComponent(ludoterapia)
                    .addComponent(psicomotricidade))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(estimulacao)
                    .addComponent(EsProSevLopes)
                    .addComponent(artEduc)
                    .addComponent(verbotonal))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelTerapiasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Fisioterapia)
                    .addComponent(educProf)
                    .addComponent(libras)
                    .addComponent(outraEscola))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ofLinguagem)
                .addContainerGap(12, Short.MAX_VALUE))
        );

        painelBotoes1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        botaoCadastrar.setText("Cadastrar");
        botaoCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoCadastrarActionPerformed(evt);
            }
        });

        botaoPesquisar.setText("Pesquisar");
        botaoPesquisar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoPesquisarActionPerformed(evt);
            }
        });

        botaoAlterar.setText("Alterar");
        botaoAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoAlterarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelBotoes1Layout = new javax.swing.GroupLayout(painelBotoes1);
        painelBotoes1.setLayout(painelBotoes1Layout);
        painelBotoes1Layout.setHorizontalGroup(
            painelBotoes1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelBotoes1Layout.createSequentialGroup()
                .addContainerGap(42, Short.MAX_VALUE)
                .addComponent(botaoCadastrar)
                .addGap(106, 106, 106)
                .addComponent(botaoPesquisar)
                .addGap(92, 92, 92)
                .addComponent(botaoAlterar)
                .addGap(62, 62, 62))
        );
        painelBotoes1Layout.setVerticalGroup(
            painelBotoes1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelBotoes1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelBotoes1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoCadastrar)
                    .addComponent(botaoAlterar)
                    .addComponent(botaoPesquisar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        painelBotoes2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        botaoListar.setText("Listar");
        botaoListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoListarActionPerformed(evt);
            }
        });

        botaoLimpar.setText("Limpar");
        botaoLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoLimparActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelBotoes2Layout = new javax.swing.GroupLayout(painelBotoes2);
        painelBotoes2.setLayout(painelBotoes2Layout);
        painelBotoes2Layout.setHorizontalGroup(
            painelBotoes2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelBotoes2Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(botaoListar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                .addComponent(botaoLimpar)
                .addGap(47, 47, 47))
        );
        painelBotoes2Layout.setVerticalGroup(
            painelBotoes2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelBotoes2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(painelBotoes2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoListar)
                    .addComponent(botaoLimpar))
                .addContainerGap())
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Observações"));

        botaoObserva.setText("Cadastro");
        botaoObserva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoObservaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(botaoObserva, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(75, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(botaoObserva)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        botaoEncerrar.setText("Encerrar");
        botaoEncerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoEncerrarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(painelTriagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(painelTerapias, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(painelBotoes1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(painelBotoes2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(botaoEncerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
            .addGroup(layout.createSequentialGroup()
                .addComponent(painelCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(16, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(painelCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(painelTriagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(painelTerapias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(painelBotoes1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(painelBotoes2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(botaoEncerrar)))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void fActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fActionPerformed
        m.setSelected(false);
    }//GEN-LAST:event_fActionPerformed

    private void mActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mActionPerformed
        f.setSelected(false);
    }//GEN-LAST:event_mActionPerformed

    private void nActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nActionPerformed
        s.setSelected(false);
    }//GEN-LAST:event_nActionPerformed

    private void campoEndContatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoEndContatoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_campoEndContatoActionPerformed

    private void campoLivroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoLivroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_campoLivroActionPerformed

    private void botaoPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoPesquisarActionPerformed
        preparaAluno();
        controlador.pesquisar();
    }//GEN-LAST:event_botaoPesquisarActionPerformed

    private void botaoListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoListarActionPerformed
        controlador.listar();
    }//GEN-LAST:event_botaoListarActionPerformed

    private void botaoCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoCadastrarActionPerformed
        preparaAluno();
        controlador.inserir();
    }//GEN-LAST:event_botaoCadastrarActionPerformed

    private void botaoAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoAlterarActionPerformed
        preparaAluno();
        controlador.alterar();
    }//GEN-LAST:event_botaoAlterarActionPerformed

    private void botaoLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoLimparActionPerformed
        controlador.setObject(new Aluno());
        preparaTela();
    }//GEN-LAST:event_botaoLimparActionPerformed

    private void educProfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_educProfActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_educProfActionPerformed

    private void sActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sActionPerformed
        n.setSelected(false);
    }//GEN-LAST:event_sActionPerformed

    private void botaoObservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoObservaActionPerformed
        controlador.cadastrarComposicao();
    }//GEN-LAST:event_botaoObservaActionPerformed

    private void botaoEncerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoEncerrarActionPerformed
        controlador.encerrar();
        this.dispose();
    }//GEN-LAST:event_botaoEncerrarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new JanelaCadastroAluno().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox EsProSevLopes;
    private javax.swing.JCheckBox Fisioterapia;
    private javax.swing.JRadioButton a;
    private javax.swing.JCheckBox apPedagogico;
    private javax.swing.JCheckBox artEduc;
    private javax.swing.JButton botaoAlterar;
    private javax.swing.JButton botaoCadastrar;
    private javax.swing.JButton botaoEncerrar;
    private javax.swing.JButton botaoLimpar;
    private javax.swing.JButton botaoListar;
    private javax.swing.JButton botaoObserva;
    private javax.swing.JButton botaoPesquisar;
    private javax.swing.JCheckBox brinquedoteca;
    private javax.swing.JTextField campoCartorio;
    private javax.swing.JTextField campoCidade;
    private javax.swing.JTextField campoCpf;
    private javax.swing.JTextField campoEndContato;
    private javax.swing.JTextField campoEscola;
    private javax.swing.JTextField campoFolha;
    private javax.swing.JTextField campoLivro;
    private javax.swing.JTextField campoNaturalidade;
    private javax.swing.JTextField campoNome;
    private javax.swing.JTextField campoNumRegistro;
    private javax.swing.JTextField campoPais;
    private javax.swing.JTextField campoProfMae;
    private javax.swing.JTextField campoProfPai;
    private javax.swing.JTextField campoRespCliente;
    private javax.swing.JTextField campoRespInscricao;
    private javax.swing.JTextField campoRg;
    private javax.swing.JTextField campoTelContato;
    private javax.swing.JTextField campoTurno;
    private com.toedter.calendar.JDateChooser dataEmissao;
    private com.toedter.calendar.JDateChooser dataNascimento;
    private javax.swing.JCheckBox edFisiEscolar;
    private javax.swing.JCheckBox educProf;
    private javax.swing.JCheckBox estimulacao;
    private javax.swing.JRadioButton f;
    private javax.swing.JCheckBox fisioterapica;
    private javax.swing.JCheckBox fonoaudiologica;
    private javax.swing.JCheckBox fonoterapia;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JCheckBox libras;
    private javax.swing.JCheckBox ludoterapia;
    private javax.swing.JRadioButton m;
    private javax.swing.JCheckBox medica;
    private javax.swing.JRadioButton n;
    private javax.swing.JCheckBox ofLinguagem;
    private javax.swing.JCheckBox ofPedagogico;
    private javax.swing.JCheckBox outraEscola;
    private javax.swing.JPanel painelBolsaFamilia;
    private javax.swing.JPanel painelBotoes1;
    private javax.swing.JPanel painelBotoes2;
    private javax.swing.JPanel painelCadastro;
    private javax.swing.JPanel painelSituacao;
    private javax.swing.JPanel painelTerapias;
    private javax.swing.JPanel painelTriagem;
    private javax.swing.JCheckBox pedagogica;
    private javax.swing.JCheckBox psicologica;
    private javax.swing.JCheckBox psicomotora;
    private javax.swing.JCheckBox psicomotricidade;
    private javax.swing.JRadioButton s;
    private javax.swing.JPanel sexo;
    private javax.swing.JCheckBox treinaDesportivo;
    private javax.swing.JCheckBox verbotonal;
    // End of variables declaration//GEN-END:variables
    private Controlador controlador;

    @Override
    public void preparaTela() {
        a.setSelected(((Aluno)controlador.getObject()).isSituacao());
        apPedagogico.setSelected(((Aluno)controlador.getObject()).isApoioPedagogico());
        artEduc.setSelected(((Aluno)controlador.getObject()).isArtEducacao());
        campoCartorio.setText(((Aluno)controlador.getObject()).getCartorio());
        campoCidade.setText(((Aluno)controlador.getObject()).getCidade());
        campoCpf.setText(((Aluno)controlador.getObject()).getCpf());
        campoEndContato.setText(((Aluno)controlador.getObject()).getEndContato());
        campoEscola.setText(((Aluno)controlador.getObject()).getEscola());
        campoFolha.setText(((Aluno)controlador.getObject()).getFolha());
        campoLivro.setText(((Aluno)controlador.getObject()).getLivro());
        campoNaturalidade.setText(((Aluno)controlador.getObject()).getNaturalidade());
        campoNome.setText(((Aluno) controlador.getObject()).getNomeAluno());
        campoNumRegistro.setText(((Aluno)controlador.getObject()).getNumRegistro());
        campoPais.setText(((Aluno)controlador.getObject()).getPais());
        campoProfMae.setText(((Aluno)controlador.getObject()).getProfMae());
        campoProfPai.setText(((Aluno)controlador.getObject()).getProfPai());
        campoRespCliente.setText(((Aluno)controlador.getObject()).getRespCliente());
        campoRespInscricao.setText(((Aluno)controlador.getObject()).getRespInscricao());
        campoRg.setText(((Aluno)controlador.getObject()).getRg());
        campoTelContato.setText(((Aluno)controlador.getObject()).getTelContato());
        campoTurno.setText(((Aluno)controlador.getObject()).getTurno());
        EsProSevLopes.setSelected(((Aluno)controlador.getObject()).isEsProfSevLopes());
        Fisioterapia.setSelected(((Aluno)controlador.getObject()).isFisioterapia());
        if(((Aluno)controlador.getObject()).equals(new Aluno())){
            dataEmissao.setDate(null);
            dataNascimento.setDate(null);
        }else{
            dataEmissao.setDate(((Aluno)controlador.getObject()).getDataEmissao());
            dataNascimento.setDate(((Aluno)controlador.getObject()).getDataNascimento());
        }
        edFisiEscolar.setSelected(((Aluno)controlador.getObject()).isEdFisiEscolar());
        educProf.setSelected(((Aluno)controlador.getObject()).isEducProfissional());
        estimulacao.setSelected(((Aluno)controlador.getObject()).isEstimulacao());
        if(((Aluno)controlador.getObject()).getSexo() == 1){
            m.setSelected(true);
            f.setSelected(false);
        }else if(((Aluno)controlador.getObject()).getSexo() == 2){
            f.setSelected(true);
            m.setSelected(false);
        }else{
            f.setSelected(false);
            m.setSelected(false);
        }
        fisioterapica.setSelected(((Aluno)controlador.getObject()).isFisioterapica());
        fonoaudiologica.setSelected(((Aluno)controlador.getObject()).isFonoaudiologica());
        fonoterapia.setSelected(((Aluno)controlador.getObject()).isFonoterapia());
        libras.setSelected(((Aluno)controlador.getObject()).isLibras());
        ludoterapia.setSelected(((Aluno)controlador.getObject()).isLudoterapia());
        medica.setSelected(((Aluno)controlador.getObject()).isMedica());
        ofLinguagem.setSelected(((Aluno)controlador.getObject()).isOfLinguagem());
        ofPedagogico.setSelected(((Aluno)controlador.getObject()).isOfPedagogica());
        outraEscola.setSelected(((Aluno)controlador.getObject()).isOutraEscola());
        pedagogica.setSelected(((Aluno)controlador.getObject()).isPedagogica());
        psicologica.setSelected(((Aluno)controlador.getObject()).isPsicologica());
        psicomotora.setSelected(((Aluno)controlador.getObject()).isPsicomotora());
        psicomotricidade.setSelected(((Aluno)controlador.getObject()).isPsicomotricidade());
        treinaDesportivo.setSelected(((Aluno)controlador.getObject()).isTreinaDesportivo());
        verbotonal.setSelected(((Aluno)controlador.getObject()).isVerbotonal());
        if(((Aluno)controlador.getObject()).equals(new Aluno())){
            botaoAlterar.setEnabled(false);
            botaoCadastrar.setEnabled(true);
            botaoObserva.setVisible(false);
            botaoPesquisar.setEnabled(true);
        }else{
            botaoAlterar.setEnabled(true);
            botaoCadastrar.setEnabled(false);
            botaoObserva.setVisible(true);
            botaoPesquisar.setEnabled(false);
        }
    }

    private void formatarCamposDeNumeros() {
        campoCpf.addKeyListener(new KeyListener() {

            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();

                if (!Character.isDigit(c)) {
                    e.consume();
                }
            }

            public void keyPressed(KeyEvent e) {
            }

            public void keyReleased(KeyEvent e) {
            }
        });

        campoNumRegistro.addKeyListener(new KeyListener() {

            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();

                if (!Character.isDigit(c)) {
                    e.consume();
                }
            }

            public void keyPressed(KeyEvent e) {
            }

            public void keyReleased(KeyEvent e) {
            }
        });

        campoTelContato.addKeyListener(new KeyListener() {

            public void keyTyped(KeyEvent e) {
                char c = e.getKeyChar();

                if (!Character.isDigit(c)) {
                    e.consume();
                }
            }

            public void keyPressed(KeyEvent e) {
            }

            public void keyReleased(KeyEvent e) {
            }
        });
    }

    @Override
    public void setControlador(Controlador controlador) {
        this.controlador = (ControladorAluno)controlador;
    }

    @Override
    public void setVisivel(Boolean visivel) {
        setVisible(visivel);
    }

    private void preparaAluno() {
        ((Aluno) controlador.getObject()).setApoioPedagogico(apPedagogico.isSelected());
        ((Aluno) controlador.getObject()).setArtEducacao(artEduc.isSelected());
        if (n.isSelected()) {
            ((Aluno) controlador.getObject()).setBolsaFamilia(false);
        } else if (s.isSelected()) {
            ((Aluno) controlador.getObject()).setBolsaFamilia(true);
        }
        ((Aluno) controlador.getObject()).setBrinquedoteca(brinquedoteca.isSelected());
        ((Aluno) controlador.getObject()).setCartorio(campoCartorio.getText().trim());
        ((Aluno) controlador.getObject()).setCidade(campoCidade.getText().trim());
        ((Aluno) controlador.getObject()).setCpf(campoCpf.getText().trim());
        if(dataEmissao.getDate() != null){
            ((Aluno) controlador.getObject()).setDataEmissao(dataEmissao.getDate());
        }else{
            ((Aluno) controlador.getObject()).setDataEmissao(new Date(1L));
        }
        if(dataNascimento.getDate() != null){
            ((Aluno) controlador.getObject()).setDataNascimento(dataNascimento.getDate());
        }else{
            ((Aluno) controlador.getObject()).setDataNascimento(new Date(1L));
        }
        ((Aluno) controlador.getObject()).setEdFisiEscolar(edFisiEscolar.isSelected());
        ((Aluno) controlador.getObject()).setEducProfissional(educProf.isSelected());
        ((Aluno) controlador.getObject()).setEndContato(campoEndContato.getText().trim());
        ((Aluno) controlador.getObject()).setEsProfSevLopes(EsProSevLopes.isSelected());
        ((Aluno) controlador.getObject()).setEscola(campoEscola.getText().trim());
        ((Aluno) controlador.getObject()).setEstimulacao(estimulacao.isSelected());
        ((Aluno) controlador.getObject()).setFisioterapia(Fisioterapia.isSelected());
        ((Aluno) controlador.getObject()).setFisioterapica(fisioterapica.isSelected());
        ((Aluno) controlador.getObject()).setFolha(campoFolha.getText().trim());
        ((Aluno) controlador.getObject()).setFonoaudiologica(fonoaudiologica.isSelected());
        ((Aluno) controlador.getObject()).setFonoterapia(fonoterapia.isSelected());
        ((Aluno) controlador.getObject()).setLibras(libras.isSelected());
        ((Aluno) controlador.getObject()).setLivro(campoLivro.getText().trim());
        ((Aluno) controlador.getObject()).setLudoterapia(ludoterapia.isSelected());
        ((Aluno) controlador.getObject()).setMedica(medica.isSelected());
        ((Aluno) controlador.getObject()).setNaturalidade(campoNaturalidade.getText().trim());
        ((Aluno) controlador.getObject()).setNomeAluno(campoNome.getText().trim());
        ((Aluno) controlador.getObject()).setNumRegistro(campoNumRegistro.getText().trim());
        ((Aluno) controlador.getObject()).setOfLinguagem(ofLinguagem.isSelected());
        ((Aluno) controlador.getObject()).setOfPedagogica(ofPedagogico.isSelected());
        ((Aluno) controlador.getObject()).setOutraEscola(outraEscola.isSelected());
        ((Aluno) controlador.getObject()).setPais(campoPais.getText().trim());
        ((Aluno) controlador.getObject()).setPedagogica(pedagogica.isSelected());
        ((Aluno) controlador.getObject()).setProfMae(campoProfMae.getText().trim());
        ((Aluno) controlador.getObject()).setProfPai(campoProfPai.getText().trim());
        ((Aluno) controlador.getObject()).setPsicologica(psicologica.isSelected());
        ((Aluno) controlador.getObject()).setPsicomotora(psicomotora.isSelected());
        ((Aluno) controlador.getObject()).setPsicomotricidade(psicomotricidade.isSelected());
        ((Aluno) controlador.getObject()).setRespCliente(campoRespCliente.getText().trim());
        ((Aluno) controlador.getObject()).setRespInscricao(campoRespInscricao.getText().trim());
        ((Aluno) controlador.getObject()).setRg(campoRg.getText().trim());
        if (m.isSelected()) {
            ((Aluno) controlador.getObject()).setSexo(1);
        }else if(f.isSelected()){
            ((Aluno)controlador.getObject()).setSexo(2);
        }
        ((Aluno)controlador.getObject()).setSituacao(a.isSelected());
        ((Aluno)controlador.getObject()).setTelContato(campoTelContato.getText().trim());
        ((Aluno)controlador.getObject()).setTreinaDesportivo(treinaDesportivo.isSelected());
        ((Aluno)controlador.getObject()).setTurno(campoTurno.getText().trim());
        ((Aluno)controlador.getObject()).setVerbotonal(verbotonal.isSelected());
    }
}
